package com.zyg.controller;

import com.zyg.model.Result;
import com.zyg.model.param.RoleParam;
import com.zyg.model.query.SysRoleQueryParam;
import com.zyg.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

@RequestMapping("/va/role")
@RestController
public class SysRoleController {

    @Autowired
    private SysRoleService sysRoleService;

    /**
     * 获取角色分页列表
     * @param sysRoleQueryParam
     * @return
     */
    @GetMapping("/page")
    public Result getAllRolePageList(@Validated SysRoleQueryParam sysRoleQueryParam){
        return sysRoleService.getAllRolePageList(sysRoleQueryParam);
    }

    /**
     * 通过id获取角色信息
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    public Result getRoleById(@PathVariable String id){
        return null;
    }

    /**
     * 添加角色
     * @param param
     * @return
     */
    @PostMapping
    public Result saveRole(RoleParam param){
        return null;
    }

    /**
     * 更新角色信息
     * @param param
     * @return
     */
    @PutMapping
    public Result updateRole(RoleParam param){
        return null;
    }

    @DeleteMapping
    public Result deleteRoleById(){
        return null;
    }

    /**
     * 获取角色树形结构
     * @return
     */
    @GetMapping("/tree-list")
    public Result getAllRoleTreeList(){
        return sysRoleService.getAllRoleTreeList();
    }

}
